package com.es.disped.dao.mapper;

import com.es.disped.dao.model.Syllabus;
import com.es.disped.dao.model.SyllabusExample;
import java.util.List;

import org.apache.ibatis.annotations.CacheNamespace;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;

//@CacheNamespace(implementation=(com.es.disped.dao.cache.RedisCache.class),size=512,flushInterval=60000)
public interface SyllabusMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table syllabus
     *
     * @mbg.generated Sat Jul 06 14:21:08 CST 2019
     */
    @SelectProvider(type=SyllabusSqlProvider.class, method="countByExample")
    long countByExample(SyllabusExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table syllabus
     *
     * @mbg.generated Sat Jul 06 14:21:08 CST 2019
     */
    @DeleteProvider(type=SyllabusSqlProvider.class, method="deleteByExample")
    int deleteByExample(SyllabusExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table syllabus
     *
     * @mbg.generated Sat Jul 06 14:21:08 CST 2019
     */
    @Delete({
        "delete from syllabus",
        "where syllabus_id = #{syllabusId,jdbcType=CHAR}"
    })
    int deleteByPrimaryKey(String syllabusId);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table syllabus
     *
     * @mbg.generated Sat Jul 06 14:21:08 CST 2019
     */
    @Insert({
        "insert into syllabus (syllabus_id, syllabus_name, ",
        "template_id, template_name, ",
        "address, syllabus_begin_day, ",
        "syllabus_end_day, teach_way, ",
        "reminder_time, syllabus_valid)",
        "values (#{syllabusId,jdbcType=CHAR}, #{syllabusName,jdbcType=VARCHAR}, ",
        "#{templateId,jdbcType=CHAR}, #{templateName,jdbcType=VARCHAR}, ",
        "#{address,jdbcType=VARCHAR}, #{syllabusBeginDay,jdbcType=VARCHAR}, ",
        "#{syllabusEndDay,jdbcType=VARCHAR}, #{teachWay,jdbcType=VARCHAR}, ",
        "#{reminderTime,jdbcType=VARCHAR}, #{syllabusValid,jdbcType=INTEGER})"
    })
    int insert(Syllabus record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table syllabus
     *
     * @mbg.generated Sat Jul 06 14:21:08 CST 2019
     */
    @InsertProvider(type=SyllabusSqlProvider.class, method="insertSelective")
    int insertSelective(Syllabus record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table syllabus
     *
     * @mbg.generated Sat Jul 06 14:21:08 CST 2019
     */
    @SelectProvider(type=SyllabusSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="syllabus_id", property="syllabusId", jdbcType=JdbcType.CHAR, id=true),
        @Result(column="syllabus_name", property="syllabusName", jdbcType=JdbcType.VARCHAR),
        @Result(column="template_id", property="templateId", jdbcType=JdbcType.CHAR),
        @Result(column="template_name", property="templateName", jdbcType=JdbcType.VARCHAR),
        @Result(column="address", property="address", jdbcType=JdbcType.VARCHAR),
        @Result(column="syllabus_begin_day", property="syllabusBeginDay", jdbcType=JdbcType.VARCHAR),
        @Result(column="syllabus_end_day", property="syllabusEndDay", jdbcType=JdbcType.VARCHAR),
        @Result(column="teach_way", property="teachWay", jdbcType=JdbcType.VARCHAR),
        @Result(column="reminder_time", property="reminderTime", jdbcType=JdbcType.VARCHAR),
        @Result(column="syllabus_valid", property="syllabusValid", jdbcType=JdbcType.INTEGER)
    })
    List<Syllabus> selectByExample(SyllabusExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table syllabus
     *
     * @mbg.generated Sat Jul 06 14:21:08 CST 2019
     */
    @Select({
        "select",
        "syllabus_id, syllabus_name, template_id, template_name, address, syllabus_begin_day, ",
        "syllabus_end_day, teach_way, reminder_time, syllabus_valid",
        "from syllabus",
        "where syllabus_id = #{syllabusId,jdbcType=CHAR}"
    })
    @Results({
        @Result(column="syllabus_id", property="syllabusId", jdbcType=JdbcType.CHAR, id=true),
        @Result(column="syllabus_name", property="syllabusName", jdbcType=JdbcType.VARCHAR),
        @Result(column="template_id", property="templateId", jdbcType=JdbcType.CHAR),
        @Result(column="template_name", property="templateName", jdbcType=JdbcType.VARCHAR),
        @Result(column="address", property="address", jdbcType=JdbcType.VARCHAR),
        @Result(column="syllabus_begin_day", property="syllabusBeginDay", jdbcType=JdbcType.VARCHAR),
        @Result(column="syllabus_end_day", property="syllabusEndDay", jdbcType=JdbcType.VARCHAR),
        @Result(column="teach_way", property="teachWay", jdbcType=JdbcType.VARCHAR),
        @Result(column="reminder_time", property="reminderTime", jdbcType=JdbcType.VARCHAR),
        @Result(column="syllabus_valid", property="syllabusValid", jdbcType=JdbcType.INTEGER)
    })
    Syllabus selectByPrimaryKey(String syllabusId);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table syllabus
     *
     * @mbg.generated Sat Jul 06 14:21:08 CST 2019
     */
    @UpdateProvider(type=SyllabusSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") Syllabus record, @Param("example") SyllabusExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table syllabus
     *
     * @mbg.generated Sat Jul 06 14:21:08 CST 2019
     */
    @UpdateProvider(type=SyllabusSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") Syllabus record, @Param("example") SyllabusExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table syllabus
     *
     * @mbg.generated Sat Jul 06 14:21:08 CST 2019
     */
    @UpdateProvider(type=SyllabusSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(Syllabus record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table syllabus
     *
     * @mbg.generated Sat Jul 06 14:21:08 CST 2019
     */
    @Update({
        "update syllabus",
        "set syllabus_name = #{syllabusName,jdbcType=VARCHAR},",
          "template_id = #{templateId,jdbcType=CHAR},",
          "template_name = #{templateName,jdbcType=VARCHAR},",
          "address = #{address,jdbcType=VARCHAR},",
          "syllabus_begin_day = #{syllabusBeginDay,jdbcType=VARCHAR},",
          "syllabus_end_day = #{syllabusEndDay,jdbcType=VARCHAR},",
          "teach_way = #{teachWay,jdbcType=VARCHAR},",
          "reminder_time = #{reminderTime,jdbcType=VARCHAR},",
          "syllabus_valid = #{syllabusValid,jdbcType=INTEGER}",
        "where syllabus_id = #{syllabusId,jdbcType=CHAR}"
    })
    int updateByPrimaryKey(Syllabus record);
}